package com.angis.fx.db;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;

public class BusinessTypeDBHelper extends ObjectDBHelper{
	
	public static final String TABLE_NAME = "businesstype";
	
	public static final String COLUMN_BID = "bid";
	
	public static final String COLUMN_BDESC = "bdesc";
	
	public BusinessTypeDBHelper(Context context) {
		super(context);
	}
	
	public long insert(ContentValues values){
		return super.insert(TABLE_NAME, values);
	}
	
	public long deleteAll() {
		if(null == writeDB) {
			writeDB = dbHelper.getWritableDatabase();
		}
		return writeDB.delete(TABLE_NAME, null, null);
	}
	
	public Cursor getAllBusinessTypes(){
		if (readDB == null)
			readDB = dbHelper.getReadableDatabase();
		return readDB.query(TABLE_NAME, new String[]{COLUMN_BID, COLUMN_BDESC}, null, null, null, null, null);
	}
	

}
